#include "NumericSample.h"

namespace Entities {

INIT_FACTORY(NumericSample)

NumericSample::NumericSample(double d){
	sample = d;
}

ObjectInputStream & NumericSample::load(ObjectInputStream & iis){
	iis >> sample;
	return iis;
}

ObjectOutputStream & NumericSample::save(ObjectOutputStream & oos) const {
	oos << sample;
	return oos;
}

double abs(const NumericSample & c){
	return std::abs(c.sample);
}

double fabs(const NumericSample & c){
	return std::fabs(c.sample);
}

NumericSample exp(const NumericSample & c){
	return NumericSample(std::exp(c.sample));
}

NumericSample cosh(const NumericSample & c){
	return NumericSample(std::cosh(c.sample));
}

NumericSample sinh(const NumericSample & c){
	return NumericSample(std::sinh(c.sample));
}

NumericSample cos(const NumericSample & c){
	return NumericSample(std::cos(c.sample));
}

NumericSample sin(const NumericSample & c){
	return NumericSample(std::sin(c.sample));
}

NumericSample log(const NumericSample & c){
	return NumericSample(std::log(c.sample));
}

NumericSample pow(const NumericSample & c1, double d){
	return NumericSample(std::pow(c1.sample, d));
}

NumericSample pow(const NumericSample c, int p){
	return NumericSample(std::pow(c.sample, p));
}

NumericSample sqrt(const NumericSample & c){
	return NumericSample(std::sqrt(c.sample));
}

NumericSample log10(const NumericSample & c){
	return NumericSample(std::log10(c.sample));
}

}
